function Log() {
}

Log.prototype.type = ['primary', 'success', 'warn', 'error', 'info'];

Log.prototype.typeColor = function (type) {
    let color = '';
    switch (type) {
        case 'primary':
            color = '#2d8cf0';
            break;
        case 'success':
            color = '#19be6b';
            break;
        case 'info':
            color = '#909399';
            break;
        case 'warn':
            color = '#ff9900';
            break;
        case 'error':
            color = '#f03f14';
            break;
        default:
            color = '#35495E';
            break;
    }
    return color;
};

Log.prototype.isArray = function (obj) {
    return Object.prototype.toString.call(obj) === '[object Array]';
};

Log.prototype.print = function (text, type = 'default', back = false) {
    console.log(text);
};

Log.prototype.printBack = function (type = 'primary', title) {
    this.print(type, title, true);
};

Log.prototype.pretty = function (type = 'primary', title, text) {
    console.log(text);
};

Log.prototype.prettyPrimary = function (title, ...text) {
    text.forEach(t => this.pretty('primary', title, t));
};

Log.prototype.prettySuccess = function (title, ...text) {
    text.forEach(t => this.pretty('success', title, t));
};

Log.prototype.prettyWarn = function (title, ...text) {
    text.forEach(t => this.pretty('warn', title, t));
};

Log.prototype.prettyError = function (title, ...text) {
    text.forEach(t => this.pretty('error', title, t));
};

Log.prototype.prettyInfo = function (title, ...text) {
    text.forEach(t => this.pretty('info', title, t));
};

export default new Log();
